# Tellitests - c2008, Telligent Systems, Inc.
# See LICENSE.txt for license details.
#
# String class
#
# Description:
# This class allows you to override, overload and extend the String class.
#

class String
  def mgsub(key_value_pairs=[].freeze)
    regexp_fragments = key_value_pairs.collect { |k,v| k }
    gsub(Regexp.union(*regexp_fragments)) do |match|
      key_value_pairs.detect{|k,v| k =~ match}[1]
    end	
  end
end

